/**
 * 点击谁显示谁的页面
 * @type {NodeListOf<Element>}
 */
var directorys = document.querySelectorAll(".directory");
var as = document.querySelectorAll(".a");
for (var i = 0; i < directorys.length; i++) {

    directorys[i].onclick = function () {
        for (var j = 0; j < as.length; j++) {
            as[j].style.display = "none";

        }
        this.lastElementChild.style.display = "block";

    }
}


var more=document.querySelectorAll(".more_1");

for (var i = 0; i <more.length;i++){
    more[i].onclick=function () {
        for (var j=0;j<more.length;j++){
            more[j].parentElement.style.background="#f6f6f8";
            more[j].style.color="black"
        }
        this.parentElement.style.background="#00d7c6";
        this.style.color="#ffffff"
    }

}

/**
 * 全选按钮
 * @type {Element | null}
 */
var btn = document.querySelector(".chall");
var put = document.querySelectorAll("input[type=checkbox]");
for (var i = 0; i < put.length-1; i++) {
    put[i].onclick = function () {
        if (!this.checked) {
            put[put.length - 1].checked = false;
        }
    }
}
btn.onclick = function () {
    if (put[put.length - 1].checked === true) {
        console.log(1);
        for (var i = 0; i < put.length-1; i++) {
            put[i].checked = true;
        }
    } else {
        for (var i = 0; i < put.length-1; i++) {
            put[i].checked = false;
        }
    }
}

function refresh_click() {
    location.reload(true);
}

/**
 * 预览简历按钮点击事件
 */
function edit_click() {
    window.location.href = "../resume/create.html";
}

/**
 * 删除按钮点击事件
 * @param e
 */
function deleteFunction(e) {
    e.parentElement.parentElement.parentElement.removeChild(e.parentElement.parentElement)
}